ABC126 C - Dice and Coin
https://atcoder.jp/contests/abc126/tasks/abc126_c
提出
code: python
n, k = map(int, input().split())
ans = 0
for i in range(1, n+1):
score = i
coins = 0
while (score < k):
coins += 1
score *= 2
if (coins == 0):
ans += 1 / n
else:
ans += (1 / n) * pow(0.5, coins)
print(ans)